const fs = require('fs');

const route = {
    '/api/login': (murl, res) => {
        if (murl.searchParams.get('username') == 'mikaisa' && murl.searchParams.get('password') == '123456') {
            res.write(`OK`);
        } else {
            res.write(`NOT OK`);
        }
    },
    '/404':(murl,res)=>{
        res.write(fs.readFileSync('./404.html','utf-8'));
    }
}

module.exports = route;